<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class THisdataGenerator extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_hisdata_Generator', function (Blueprint $table) {
             $table->engine = 'MyISAM';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->increments('hd_index')->nullable(false)->comment('');
			$table->datetime('rd_updatetime')->nullable()->default(null)->comment('');
			$table->datetime('hd_datetime')->nullable()->default(null)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->float('hd_EleUab', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleUbc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleUac', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleUa', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleUb', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleUc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenUab', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenUbc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenUac', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenUa', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenUb', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenUc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleIa', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleIb', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleIc', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_PowFac', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_WatTemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_OilPre', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_FueLev', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_BatVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_CharVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EleFre', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_GenFre', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ActPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReaPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_A', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_B', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_C', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_AppPow_All', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_EngSpeed', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('hd_PubAlarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_PubOutageAlarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_PubWarnAlarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_PubEleAlarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_EmerShut')->nullable()->default(0)->comment('');
			$table->boolean('hd_HighWaterTemp')->nullable()->default(0)->comment('');
			$table->boolean('hd_LowOilPre')->nullable()->default(0)->comment('');
			$table->boolean('hd_OveGen')->nullable()->default(0)->comment('');
			$table->boolean('hd_UnderSpeedGen')->nullable()->default(0)->comment('');
			$table->boolean('hd_LosVelSig')->nullable()->default(0)->comment('');
			$table->boolean('hd_OverFre')->nullable()->default(0)->comment('');
			$table->boolean('hd_UnderFre')->nullable()->default(0)->comment('');
			$table->boolean('hd_OverVol')->nullable()->default(0)->comment('');
			$table->boolean('hd_UnderVol')->nullable()->default(0)->comment('');
			$table->boolean('hd_OverCur')->nullable()->default(0)->comment('');
			$table->boolean('hd_StaFail')->nullable()->default(0)->comment('');
			$table->boolean('hd_OilPreSenOpen')->nullable()->default(0)->comment('');
			$table->boolean('hd_InputPortShut')->nullable()->default(0)->comment('');
			$table->boolean('hd_OverCurTrip')->nullable()->default(0)->comment('');
			$table->boolean('hd_EleTripInPort')->nullable()->default(0)->comment('');
			$table->boolean('hd_DownFaill')->nullable()->default(0)->comment('');
			$table->boolean('hd_LowFuelLev')->nullable()->default(0)->comment('');
			$table->boolean('hd_ChaFai')->nullable()->default(0)->comment('');
			$table->boolean('hd_BatUnderVol')->nullable()->default(0)->comment('');
			$table->boolean('hd_BatOverVol')->nullable()->default(0)->comment('');
			$table->boolean('hd_InputWarn')->nullable()->default(0)->comment('');
			$table->boolean('hd_EleAbno')->nullable()->default(0)->comment('');
			$table->boolean('hd_GenAbno')->nullable()->default(0)->comment('');
			$table->boolean('hd_CommSta')->nullable()->default(0)->comment('');
			$table->boolean('hd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('hd_index', 'hd_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_hisdata_Generator');
    }
}
